<template>
  <div class="author-info">
    <div class="author-info-main">
      <div class="author-info-avatar">
        <img :src="info.avatar_large" alt="">
      </div>
      <div class="author-info-content">
        <div class="anthor-info-name">
          {{ info.user_name }}
        </div>
        <div class="author-info-time">
          {{ publishTime }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    info: {
      type: Object
    },
    createTime: String
  },
  computed: {
    publishTime() {
      return new Date(this.createTime * 1000).toLocaleString()
    }
  },
  created() {
    console.log(this.info);
  }
}
</script>

<style lang="less" scoped>
.author-info{
  width: 100%;
  height: 50px;
}
.author-info-main{
  width: 70%;
  height: 100%;
  display: flex;
}
.author-info-avatar{
  height: 100%;
  img {
    border-radius: 50%;
    width: 40px;
  }
}
.author-info-content{
  padding-left: 10px;
  .anthor-info-name{
    font-size: 18px;
    font-weight: bolder;
  }
  .author-info-time{
    font-size: 14px;
    color: #909090;
  }
}
</style>